<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	List<BatDstarea> list = (List<BatDstarea>)request.getAttribute("list");
	AreaForm form = (AreaForm)request.getAttribute("command");
	String siteId = StringUtils.isNotBlank(form.getSiteId())?form.getSiteId():"";
	String siteName = StringUtils.isNotBlank(form.getSiteName())?form.getSiteName():"";
	String markName = StringUtils.isNotBlank(form.getMarkName())?form.getMarkName():"";
	String fldsitenames = StringUtils.isNotBlank(form.getFldsitenames())?form.getFldsitenames():"";
	String areaName = StringUtils.isNotBlank(form.getAreaName())?form.getAreaName():"";
%>

<div class="userListWrap">
    <form id="userListForm">
        <div class="form-item">
    		<label for="userId">站点编号:</label>
    		<input class="easyui-validatebox" type="text" name="siteId" data-options="" value="<%=siteId%>"/>
        </div>
       	<div class="form-item">
    		<label for="userId">站点名称:</label>
    		<input class="easyui-validatebox" type="text" name="siteName" data-options="" value="<%=siteName%>"/>
        </div>
       	<div class="form-item">
    		<label for="userId">抬头:</label>
    		<input class="easyui-validatebox" type="text" name="markName" data-options="" value="<%=areaName%>"/>
        </div>
        <div class="form-item form-item">
        	<label for="deptId"></label>
    		<a href="javascript:XF.Area.listAreaSearch()" class="input-btn-microsoft input-btn-microsoft-24">搜索</a>
        </div>
        
    </form>

    <table id="noticeListTable" class="easyui-datagrid"  title="" >
        <thead>
    		<tr>
    		    <th data-options="field:'fldidd',width:80" orderByField='fldidd' >
					<a class="order-field" href="javascript:XF.Area.listAreaSearch('fldidd')" >区域编号</a>
					<%
						if(StringUtils.isNotBlank(form.getOrderByField()) && StringUtils.isNotBlank(form.getOrderByMode())){
							if("fldidd".equalsIgnoreCase(form.getOrderByField())){
								if("asc".equalsIgnoreCase(form.getOrderByMode())){
									%><span class="px t" orderByMode='desc'>&nbsp;</span><%
								}else if("desc".equalsIgnoreCase(form.getOrderByMode())){
									%><span class="px d" orderByMode='asc'>&nbsp;</span><%
								}else{
									%><span class="px" orderByMode='asc'>&nbsp;</span><%
								}
							}else{
								%><span class="px" orderByMode='asc'>&nbsp;</span><%
							}
						}else{
							%><span class="px" orderByMode='asc'>&nbsp;</span><%
						}
					%>
				</th>
    			<th data-options="field:'fldsitenames222',width:80" orderByField='fldsitenames' >
					<a class="order-field" href="javascript:XF.Area.listAreaSearch('fldsitenames')" >区域名称</a>
					<%
						if(StringUtils.isNotBlank(form.getOrderByField()) && StringUtils.isNotBlank(form.getOrderByMode())){
							if("fldsitenames".equalsIgnoreCase(form.getOrderByField())){
								if("asc".equalsIgnoreCase(form.getOrderByMode())){
									%><span class="px t" orderByMode='desc'>&nbsp;</span><%
								}else if("desc".equalsIgnoreCase(form.getOrderByMode())){
									%><span class="px d" orderByMode='asc'>&nbsp;</span><%
								}else{
									%><span class="px" orderByMode='asc'>&nbsp;</span><%
								}
							}else{
								%><span class="px" orderByMode='asc'>&nbsp;</span><%
							}
						}else{
							%><span class="px" orderByMode='asc'>&nbsp;</span><%
						}
					%>
				</th>
				<th data-options="field:'siteId',width:100" orderByField='siteid' >
					<a class="order-field" href="javascript:XF.Area.listAreaSearch('siteid')" >所属站点编号</a>
					<%
						if(StringUtils.isNotBlank(form.getOrderByField()) && StringUtils.isNotBlank(form.getOrderByMode())){
							if("siteid".equalsIgnoreCase(form.getOrderByField())){
								if("asc".equalsIgnoreCase(form.getOrderByMode())){
									%><span class="px t" orderByMode='desc'>&nbsp;</span><%
								}else if("desc".equalsIgnoreCase(form.getOrderByMode())){
									%><span class="px d" orderByMode='asc'>&nbsp;</span><%
								}else{
									%><span class="px" orderByMode='asc'>&nbsp;</span><%
								}
							}else{
								%><span class="px" orderByMode='asc'>&nbsp;</span><%
							}
						}else{
							%><span class="px" orderByMode='asc'>&nbsp;</span><%
						}
					%>
				</th>
    			<th data-options="field:'siteName',width:140" orderByField='siteName' >
					<a class="order-field" href="javascript:XF.Area.listAreaSearch('siteName')" >所属站点</a>
					<%
						if(StringUtils.isNotBlank(form.getOrderByField()) && StringUtils.isNotBlank(form.getOrderByMode())){
							if("siteName".equalsIgnoreCase(form.getOrderByField())){
								if("asc".equalsIgnoreCase(form.getOrderByMode())){
									%><span class="px t" orderByMode='desc'>&nbsp;</span><%
								}else if("desc".equalsIgnoreCase(form.getOrderByMode())){
									%><span class="px d" orderByMode='asc'>&nbsp;</span><%
								}else{
									%><span class="px" orderByMode='asc'>&nbsp;</span><%
								}
							}else{
								%><span class="px" orderByMode='asc'>&nbsp;</span><%
							}
						}else{
							%><span class="px" orderByMode='asc'>&nbsp;</span><%
						}
					%>
				</th>
<%--     			<th data-options="field:'areaName',width:100" orderByField='areaName' >
					<a class="order-field" href="javascript:XF.Area.listAreaSearch('areaName')" >所属抬头</a>
					<%
						if(StringUtils.isNotBlank(form.getOrderByField()) && StringUtils.isNotBlank(form.getOrderByMode())){
							if("areaName".equalsIgnoreCase(form.getOrderByField())){
								if("asc".equalsIgnoreCase(form.getOrderByMode())){
									%><span class="px t" orderByMode='desc'>&nbsp;</span><%
								}else if("desc".equalsIgnoreCase(form.getOrderByMode())){
									%><span class="px d" orderByMode='asc'>&nbsp;</span><%
								}else{
									%><span class="px" orderByMode='asc'>&nbsp;</span><%
								}
							}else{
								%><span class="px" orderByMode='asc'>&nbsp;</span><%
							}
						}else{
							%><span class="px" orderByMode='asc'>&nbsp;</span><%
						}
					%>
				</th> --%>
 				<th data-options="field:'province',width:80">所属省</th>
				<th data-options="field:'city',width:80" >所属城市</th>
					<th data-options="field:'opr',width:170">操作</th>
    		</tr>
        </thead>
        <tbody>
        	<%
        		if(!CollectionUtils.isEmpty(list)){
        			for(BatDstarea area:list){
        				%>
       					 <tr s="<%=EncrypTool.encode(area.getFldidd()+"") %>">
       					 	<td><%=(null!=area.getAreaId())?area.getAreaId()+"":"" %></td>
       					 	<td>
       					 		<i s="<%=EncrypTool.encode(area.getFldidd()+"")%>"></i>
       					 		<a class="inLink" style="color:#333" href="javascript:XF.Area.editArea('<%=EncrypTool.encode(area.getFldidd()+"")%>')"><span class="text-bold"><%=StringUtils.isNotBlank(area.getAreaName())?area.getAreaName():"" %></span></a>
       					 	</td>
       					 	<td><%=(null!=area.getSiteId())?area.getSiteId()+"":"" %></td>
       					 	<td><%=(null!=area.getSiteName())?area.getSiteName()+"":"" %></td>
       					 	<%-- <td><%=StringUtils.isNotBlank(area.getAreaName())?area.getAreaName():"" %></td> --%>
       					 	<td><%=(null!=area.getProvince())?area.getProvince()+"":"" %></td>
       					 	<td><%=(null!=area.getCity())?area.getCity()+"":"" %></td>
				    			<td>
										<a class="inLink" href="javascript:XF.Area.editArea('<%=EncrypTool.encode(area.getFldidd()+"")%>')"><span>编辑</span></a>
										<a href="javascript:XF.Area.deleteArea('<%=EncrypTool.encode(area.getFldofareas()+"")%>','<%=EncrypTool.encode(area.getFldidd()+"")%>')"><span>删除</span></a>
										<%-- 
										<a href="javascript:XF.Area.EditCoordinate('<%=EncrypTool.encode(area.getAreaId()+"")%>','<%=area.getAreaName()%>')"><span>编辑坐标</span></a>
										--%>
										<a href="javascript:XF.Area.EditCoordinatePopup('<%=EncrypTool.encode(area.getAreaId()+"")%>','<%=area.getAreaName()%>')"><span>编辑坐标</span></a>
				    			</td>
			    		</tr>
        				<%
        			}
        		}
        	%>
    	</tbody>
    </table>
    <div class="pagination paginationFixWidth">
		<monggoTag:pagination 
		href="area_search"
		pageSize="<%=form.getPageSize()%>" 
		totalRecord="<%=form.getTotalRecord() %>" 
		currentPage="<%=form.getPageNum() %>">
		</monggoTag:pagination> 
	</div>
</div>
<script>
	$('#noticeListTable').datagrid();  
	//XF.Notice.initList();
</script>





























